package main

import "fmt"

var cache = make(map[int]int, 10)

func fn(n int) int {
	var a int
	if _, ok := cache[n]; !ok {
		if n == 1 {
			return 1
		} else if n == 2 {
			return 2
		}
		a = fn(n-1) + fn(n-2) //f(3)=f(2)f(1)+fn(2)
		cache[n] = a

	} else {
		a = cache[n]
	}
	fmt.Println(cache)
	return a
}

func homework2() {
	fmt.Println(fn(10))

}
